package com.kotlin.base.ext

import com.kotlin.base.rx.BaseSubscriber
import rx.Observable
import rx.android.schedulers.AndroidSchedulers
import rx.schedulers.Schedulers


/**
 * @author Mr.Wang
 * @version v0.3.6
 * @time 2018/3/7
 * @describe
 */
fun <T> Observable<T>.execute(subscriber : BaseSubscriber<T>) {
    this.observeOn(AndroidSchedulers.mainThread())
//            .compose(lifecycleProvider.bindToLifecycle())
            .subscribeOn(Schedulers.io())
            .subscribe(subscriber)
}